package com.yunji.order.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yunji.common.annotation.Excel;
import com.yunji.common.base.BaseDO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;
import java.util.Date;

/**
 * @Project: yunji-coffee
 * @Package: com.yunji.order.domain
 * @Title: Trade
 * @Description: 交易信息
 * <p>
 * History:
 * Date                     Version     Author          Summary
 * ============================================================
 * 2024-04-10 14:21:12      V1.0        HuaAo       新建类
 */
@EqualsAndHashCode(callSuper = true)
@TableName("t_trade")
@Data
@ApiModel(value = "t_trade", description = "交易信息也称为对账单")
public class TradeDO extends BaseDO implements Cloneable {
    @ApiModelProperty(value = "交易ID")
    @TableId(type = IdType.AUTO)
    private Long tradeId;

    @ApiModelProperty(value = "平台流水号")
    @Excel(name = "平台流水号", width = 30)
    private String transactionNo;

    @ApiModelProperty("交易模式 0-下单 1-提现 2-退款")
    private Integer tradeMode;

    @ApiModelProperty(value = "交易类型(11:商品购买;12:钱包充值;13:钱包提现;13:商品退款;21:代理费用;22:员工分成;23:产品收益;24:代理费用退款;25:员工分成退款;26:商品收益退款;)")
    @Excel(name = "交易类型", readConverterExp = "11=免费,12=钱包充值,13=钱包提现,21=代理费用,22=员工分成,23=产品收益,24:代理费用退款,25=员工分成退款,26=商品收益退款")
    private Integer tradeType;

    @Excel(name = "交易金额", width = 10)
    @ApiModelProperty("交易金额")
    private BigDecimal tradeAmount;

//    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
//    @Excel(name = "交易时间", dateFormat = "yyyy-MM-dd HH:mm:ss", width = 30)
//    @ApiModelProperty(value = "交易时间")
//    private Date tradeTime;

    @ApiModelProperty("账户id")
    private Long accountId;

    @Excel(name = "账户类型", width = 10)
    @ApiModelProperty("账户类型")
    private String accountType;

    @Excel(name = "账户名称", width = 10)
    @ApiModelProperty("账户名称")
    private String accountName;

    @ApiModelProperty("账户电话")
    private String accountTel;

    @Excel(name = "账户余额", width = 10)
    @ApiModelProperty("账户余额")
    private BigDecimal balance;

    @ApiModelProperty("支付类型 (0:支出;1:收入; 注: 以个人钱包支出收入判断)")
    private Integer payType;

    @ApiModelProperty("支付方式 (0:余额支付;1:微信支付;2:支付宝;)")
    private Integer payMode;

    @ApiModelProperty("第三方交易时间")
    private Date apiTime;

    @ApiModelProperty("第三方交易流水号/第三方流水号")
    private String apiCode;

    @ApiModelProperty("openId")
    private String openId;

    private Long belongId;

    @Override
    public TradeDO clone() {
        try {
            return (TradeDO) super.clone();
        } catch (CloneNotSupportedException e) {
            return null;
        }
    }
}
